@import "~@/assets/less/inc/variables";
@import "~@/components/ApplicationArea/ApplicationHeader/index.less";

/****
  grid bg - based on 6 cols, 35px rows and 15px spacing
****/

// let the bg go all the way to the bottom
.dashboard-page,
.dashboard-page .container {
  display: flex;
  flex-grow: 1;
  flex-direction: column;
  width: 100%;
}

#dashboard-container {
  position: relative;
  flex-grow: 1;
  display: flex;
}

.dashboard-header {
  padding: 0 15px !important;
  margin: 0 0 10px !important;
  position: -webkit-sticky; // required for Safari
  position: sticky;
  background: #f6f7f9;
  z-index: 99;
  width: 100%;
  top: 0;

  @media @mobileBreakpoint {
    & {
      padding: 0 !important;
      position: static;
    }
  }

  h3 {
    margin: 0.2em 0;
    line-height: 1.3;
    font-weight: 500;
  }

  .profile-image {
    width: 16px;
    height: 16px;
    border-radius: 100%;
    margin: 3px 5px 0 0;
  }

  .tags-control a {
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
  }

  &:hover {
    .tags-control a {
      opacity: 1;
    }
  }
}

.dashboard-control {
  margin: 8px 0;

  .icon-button {
    width: 32px;
    padding: 0 10px;
  }

  .save-status {
    vertical-align: middle;
    margin-right: 7px;
    font-size: 12px;
    text-align: left;
    display: inline-block;

    &[data-saving] {
      opacity: 0.6;
      width: 45px;

      &:after {
        content: "";
        animation: saving 2s linear infinite;
      }
    }

    &[data-error] {
      color: #f44336;
    }
  }
}

@keyframes saving {
  0%,
  100% {
    content: ".";
  }
  33% {
    content: "..";
  }
  66% {
    content: "...";
  }
}

.add-widget-container {
  background: #fff;
  border-radius: @redash-radius;
  padding: 15px;
  position: fixed;
  left: 15px;
  bottom: 20px;
  width: calc(~"100% - 30px");
  z-index: 99;
  box-shadow: fade(@redash-gray, 50%) 0px 7px 29px -3px;
  display: flex;
  justify-content: space-between;

  h2 {
    margin: 0;
    font-size: 14px;
    line-height: 2.1;
    font-weight: 400;

    .zmdi {
      margin: 0;
      margin-right: 5px;
      font-size: 24px;
      position: absolute;
      bottom: 18px;
    }

    span {
      vertical-align: middle;
      padding-left: 30px;
    }
  }

  .btn {
    align-self: center;
  }
}
